home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / ATL_Samples / count / object1.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  876 b   |  48 lines

  1. // Object1.cpp : Implementation of CObject1
  2. #include "stdafx.h"
  3. #include "Count.h"
  4. #include "Object1.h"
  5. #include "resource.h"
  6.  
  7. #include "Counter.h"
  8.  
  9.  
  10. /////////////////////////////////////////////////////////////////////////////
  11. // CObject1
  12.  
  13. STDMETHODIMP CObject1::Initialize(DWORD pInterface)
  14. {
  15.     // Save IFullCtrl1 interface
  16.     m_pICounter = (ICounter*)pInterface;
  17.  
  18.     return S_OK;
  19. }
  20.  
  21. STDMETHODIMP CObject1::Start()
  22. {
  23.     if(m_pICounter != NULL)
  24.     {
  25.         for(int i = 1; i <= m_nMax; i++)
  26.         {
  27.             TCHAR szBuf1[40] = _T("");
  28.             int nResult = LoadString (_Module.m_hInst, IDS_SENT_MESSAGES, szBuf1, sizeof(szBuf1) );
  29.  
  30.             TCHAR szBuf2[50];
  31.             wsprintf(szBuf2, szBuf1, i );
  32.             
  33.             Sleep(500);
  34.  
  35.             m_pICounter->GetInfoFromCounter(T2BSTR(szBuf2));
  36.         }
  37.     }
  38.     return S_OK;
  39. }
  40.  
  41.  
  42. STDMETHODIMP CObject1::SetMax(int nMax)
  43. {
  44.     m_nMax = nMax;
  45.  
  46.     return S_OK;
  47. }
  48.